package com.yusys.pattern.mode.decorator.mybatis;

public class CacheBuilder {

    public static void main(String[] args) {
        Cache cache = new BaseCache();
        Cache decorateCache = decorateCache(cache);
        System.out.println("first get result:"+decorateCache.getCache("1"));;
        decorateCache.putObject("1","first");
        System.out.println("second get result:"+decorateCache.getCache("1"));;


    }

    private static Cache decorateCache(Cache cache) {
        return new BlockingCache(new SynchronizedCache(cache));
    }
}
